//
//  XMNetwork.h
//  XMJJ_zml
//
//  Created by apple on 2025/5/7.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface XMNetwork : NSObject

+ (instancetype)shareInstance;

/**
 Get
 */
- (void)getDataWithPath:(NSString *)path
             parameters:(NSMutableDictionary *)parameters
              needToken:(BOOL)needToken
                headers:(NSDictionary *)headers
                success:(void (^)(id responseObject))successBlock
                failure:(void (^)(NSError *error))failureBlock;
/**
 Get  带菊花
 */
- (void)getDataWithPath:(NSString *)path
             parameters:(NSMutableDictionary *)parameters
              needToken:(BOOL)needToken
                headers:(NSDictionary *)headers
        showPrograssHUD:(BOOL)showProgressHud
                success:(void (^)(id responseObject))successBlock
                failure:(void (^)(NSError *error))failureBlock;

/**
 Post
 */
- (void)postDataWithPath:(NSString *)path
              parameters:(NSMutableDictionary *)parameters
               needToken:(BOOL)needToken
                 headers:(NSDictionary *)headers
                 success:(void (^)(id responseObject))successBlock
                 failure:(void (^)(NSError *error))failureBlock;

/**
 Post  带菊花
 */
- (void)postDataWithPath:(NSString *)path
              parameters:(NSMutableDictionary *)parameters
               needToken:(BOOL)needToken
                 headers:(NSDictionary *)headers
         showPrograssHUD:(BOOL)showProgressHud
                 success:(void (^)(id responseObject))successBlock
                 failure:(void (^)(NSError *error))failureBlock;

/**
 put
 */
- (void)putDataWithPath:(NSString *)path
             parameters:(NSMutableDictionary *)parameters
              needToken:(BOOL)needToken
                headers:(NSDictionary *)headers
        showPrograssHUD:(BOOL)showProgressHud
                success:(void (^)(id responseObject))successBlock
                failure:(nonnull void (^)(NSError *error))failureBlock;

//图片上传 单
- (void)upLoadImgWithPath:(NSString *)path
                      img:(UIImage *)img
                  success:(void (^)(id responseObject))successBlock
                  failure:(void (^)(NSError *error))failureBlock;

//图片上传 多张
- (void)upLoadImgsWithPath:(NSString *)path
                parameters:(NSMutableDictionary *)parameters
                       img:(NSArray *)imgArr
                   success:(void (^)(id responseObject))successBlock
                   failure:(void (^)(NSError *error))failureBlock;

@end

NS_ASSUME_NONNULL_END
